package com.flyduck.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.ServletRequestUtils;

import javax.servlet.http.HttpServletRequest;

/**
 * @program: vue-admin-java
 * @description:
 * @author: flyduck
 * @create: 2024-05-27 21:49
 **/
public class BaseController {

    @Autowired
    HttpServletRequest request;

    public Page getPage(){
        int current = ServletRequestUtils.getIntParameter(request, "current", 1);
        int size = ServletRequestUtils.getIntParameter(request, "size", 10);

        return new Page(current,size);
    }
}
